﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using WjAutoConfigApp.Common;

namespace WjAutoConfigApp.Models
{
    [Serializable]
    public class LanePartPropertyModel
    {

        /// <summary>
        /// 是否统计区域 "0代表否，1代表是"
        /// </summary>
        public int LanePropertyTypy { get; set; }

        /// <summary>
        /// 是否压线
        /// </summary>
        public int Value { get; set; }


        /// <summary>
        /// 重写ToString()方法
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            List<string> values = new List<string>();
            Type type = this.GetType();
            PropertyInfo[] propertyInfos = type.GetProperties();
            foreach (var property in propertyInfos)
            {
                var value = property.GetValue(this, null);
                if (value is null) value = string.Empty;
                values.Add(value.ToString());
            }
            return string.Join(";", values);
        }
    }
}
